//
//  NSObject+YXTheme.m
//  YXTheme_Example
//
//  Created by GMS on 2020/8/19.
//  Copyright © 2020 Arthur. All rights reserved.
//

#import "NSObject+YXTheme.h"
#import <objc/runtime.h>

// 记录是否已经注册过通知 防止重复注册
static BOOL const YXHasRegistChangedThemeNotification;

@implementation NSObject (YXTheme)

// MARK: 注册通知
- (void)theme_registChangeNotification {
    
    BOOL hasRegist = objc_getAssociatedObject(self, &YXHasRegistChangedThemeNotification);
    
    if (hasRegist) { // 已经注册过则直接返回
        return;
    }
    
    objc_setAssociatedObject(self, &YXHasRegistChangedThemeNotification, @(YES), OBJC_ASSOCIATION_COPY_NONATOMIC);
    
    
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(theme_didChanged) name:YXThemeChangedNotification object:nil];
}

- (void)theme_didChanged {
    
}




@end
